package com.neuedu.web.dao;

import com.neuedu.web.common.BaseDao;
import com.neuedu.web.po.ItemUploadPO;
import com.neuedu.web.po.ItemUploadPO;

import java.lang.reflect.InvocationTargetException;
import java.util.List;

/**
 * @author 金山
 * 项目：jdbc-dao
 * site: https://blog.fulfill.com.cn
 * 描述  dept 表的数据访问对象
 * @data  2024年11月21日13:38:03
 */
public class ItemUploadDao extends BaseDao<ItemUploadPO> {



    public List<ItemUploadPO> selectAll(  String sql, Object... params) throws NoSuchFieldException, InvocationTargetException, NoSuchMethodException, InstantiationException, IllegalAccessException {
        return super.selectAll(ItemUploadPO.class , sql,params);
    }
    public List<ItemUploadPO> selectPage( int current, int size, String sql, Object... params) throws NoSuchFieldException, InvocationTargetException, NoSuchMethodException, InstantiationException, IllegalAccessException {
        return super.selectPage(ItemUploadPO.class , current ,size,sql,params);
    }







    public int insert(ItemUploadPO po) {
        String sql = "INSERT INTO `his`.`item_upload` (  `item_id`, `upload_id`,`type`) VALUES(  ?,?,? )  ";
        int count = super.update(sql,
                po.getItemId(),
                po.getUploadId(),
                po.getType()
        );

        return count;

    }

    /**
     * 通用的方法
     *
     * @return
     */

    public int delete(long id) {
        StringBuffer sql = new StringBuffer();

        sql.append(" delete from item_upload where upload_id = ?");

        int count = super.update(sql.toString(),   id        );

        return count;

    }


}
